package com.jason.learn.springcloud.accountservice.mapper;

import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Update;
import org.springframework.stereotype.Component;
import org.springframework.stereotype.Repository;

import java.math.BigDecimal;
import java.util.Date;

@Mapper
@Repository
public interface AccountMapper {

    @Update("update t_account set amount=amount+#{amount} where acc_no = #{accNo}")
    public void addMoney(Long accNo, BigDecimal amount);

    @Insert("insert into t_account(acc_no,amount,add_time) values(#{accNo},#{amount},#{addTime})")
    public void addAccount(Long accNo, BigDecimal amount, Date addTime);
}
